package ph.greenova.service.impl;

import ph.greenova.persistence.model.Person;
import ph.greenova.service.serviceinterface.PersonService;
import ph.greenova.web.dto.PersonDTO;

/**
 * Created By: adrian
 * Date Created: 6:31 PM 6/5/13
 */
public class PersonServiceImpl extends BaseService implements PersonService{




    @Override
    public void createNewPerson(final PersonDTO dto) {
        final Person newPerson = new Person();

        newPerson.setFirstName(dto.getFirstName());
        newPerson.setLastName(dto.getLastName());
        newPerson.setUsername(dto.getUsername());
        newPerson.setPassword(dto.getPassword());

        getPersonDAO().create(newPerson);
    }

    @Override
    public Person findPersonByUserName(final String username) {
        return getPersonDAO().findPersonByUserName(username);
    }


}
